import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../utils/screenAdapter.dart';
import '../controllers/goods_details_controller.dart';
import 'package:flutter_html/flutter_html.dart';

class SecondPageView extends GetView<GoodsDetailsController> {
  final Function subHeader;
  const SecondPageView({super.key, required this.subHeader});
  @override
  Widget build(BuildContext context) {
    return Container(
      key: controller.gk2,
      color: Colors.white,
      width: double.infinity,
      child: Column(
        children: [
          subHeader(), //子头部
          Obx(
            () => controller.subHeaderIndex.value == 0
                ? SizedBox(
                    child: Html(
                      data: controller.goodsDetail.value.content ?? "",
                      style: {
                        "body": Style(backgroundColor: Colors.white),
                        "p": Style(fontSize: FontSize.large),
                      },
                    ),
                  )
                : SizedBox(
                    child: Html(
                      data: controller.goodsDetail.value.specs ?? "",
                      style: {
                        "body": Style(backgroundColor: Colors.white),
                        "p": Style(fontSize: FontSize.large),
                      },
                    ),
                  ),
          ),
        ],
      ),
    );
  }
}
